package com.suneee.role.utils;

import java.util.List;

import com.suneee.base.util.ContextHelper;
import com.suneee.role.entity.Role;

public class RoleUtil {
	
	private static String ADMIN_CODE = "admin";
	
	public static boolean hasAdminRole(){
		List<Role> roleList = ContextHelper.getCurrentLoginInfo().getRoleList();
		if(roleList == null || roleList.isEmpty())
			return false;
		for(Role role : roleList){
			if(ADMIN_CODE.equals(role.getCode())){
				return true;
			}
		}
		return false;
	}

}
